/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package linkedlistsample;

/**
 *
 * @author parallels
 */
public class LinkedListSample {

    private static SimpleList list;
    
    public static void main(String[] args) {
        //list = new SimpleList();
        //list.insert(new Node(2));
        //list.insert(new Node(1));
        //list.insert(new Node(5));
        //list.delete(new Node(1));
        
        list = new SimpleList();
        list.insert(new Node("2"));
        list.insert(new Node("1"));
        list.insert(new Node("1"));
        list.insert(new Node("5"));    
        display();
        
        list.delete(new Node("1"));   
        display();
    }
    
    private static void display () {
        System.out.println (" ");
        Node n = list.getFirst();
        while (n != null) {
            System.out.println (n.getObject());
            n = n.getNext();
        }
    }
}
